<template>
  <div class="MyClient-wrap">
    <el-card class="MyClient-card">
      <div slot="header" class="clearfix flex MyClient-info-top">
        <span>客户列表信息</span>
        <div class="MyClient-top-btn flex">
          <!-- 搜索 -->
          <div class="MyClient-search flex">
            <div class="MyClient-search-label">搜索：</div>
            <div class="MyClient-search-inp">
              <el-input size="small" type="text" placeholder="客户名称" />
            </div>
          </div>
          <div class="MyClient-add">
            <el-button size="small" type="primary" @click="addLogisticsFn()"
              >新增客户</el-button
            >
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
import { addLogistics } from "@/http/api.js";
export default {
  data() {
    return {
      orderCode: 1474226827,
    };
  },
  methods: {
    async addLogisticsFn() { 
      let date = new Date();
      this.orderCode = +this.orderCode + 1
      let params = {
        orderCode: `${this.orderCode}`,
        consignor: `李四${Math.floor(Math.random() * 10 + 1)}`,
        consignee: "Fancy",
        createTime: `${date.getTime()}`,
      };
      let res = await addLogistics(params);
      console.log(res);
    },
  },
};
</script>
 
<style lang="less" scoped>
.MyClient-wrap {
  .MyClient-card {
    .MyClient-info-top {
      justify-content: space-between;
      align-items: center;
      .MyClient-top-btn {
        .MyClient-search {
          align-items: center;
          font-size: 14px;
          margin-right: 15px;
        }
      }
    }
  }
}
</style>